/**
 * 
 */
package org.vsg.stock.core.persistence.mybatis;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.dao.DataAccessException;
import org.vsg.stock.core.domain.StockDailyKLine;
import org.vsg.stock.core.persistence.StockDailyKLineDao;

/**
 * @author Bill Vison
 *
 */
public class StockDailyKLineDaoImpl extends SqlSessionDaoSupport implements
		StockDailyKLineDao {

	/* (non-Javadoc)
	 * @see org.vsg.stock.core.persistence.StockDailyKLineDao#findMinVolInCycle(java.lang.String, java.util.Date, int)
	 */
	@Override
	public long findMinVolInCycle(String stockCode, Date fromDate, int cycle)
			throws DataAccessException {
		// TODO Auto-generated method stub
		return 0;
	}

	
	
	@Override
	public List<StockDailyKLine> findStockLineByCycle(String code,
			Date startDate, Date endDate) throws DataAccessException {
		
		
		Map<String,Serializable > params = new HashMap<String , Serializable>();
		params.put("stockCode", code);
		params.put("startDate", startDate);
		params.put("endDate", endDate);

		List result = this.getSqlSessionTemplate().selectList(
				"org.vsg.stock.core.domain.mybatis.StockDailyKLineProxy.findStockLineByCycle_byDate",
				params);

		return (List<StockDailyKLine>)result;		
		

	}



	/* (non-Javadoc)
	 * @see org.vsg.stock.core.persistence.StockDailyKLineDao#findOverRatioLineByInCycle(java.util.Date, java.util.Date, double)
	 */
	@Override
	public List<StockDailyKLine> findOverRatioLineByInCycle(Date startDate,
			Date endDate, double ratio) throws DataAccessException {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see org.vsg.stock.core.persistence.StockDailyKLineDao#findStockLineByAll(java.lang.String)
	 */
	@Override
	public List<StockDailyKLine> findStockLineByAll(String code)
			throws DataAccessException {
		Map<String,String> params = new HashMap<String , String>();
		params.put("stockCode", code);
		List result = this.getSqlSessionTemplate().selectList(
				"org.vsg.stock.core.domain.mybatis.StockDailyKLineProxy.findStockLineByAll",
				params);

		return (List<StockDailyKLine>)result;
	}


	/* (non-Javadoc)
	 * @see org.vsg.stock.core.persistence.StockDailyKLineDao#findStockLineByOverRatio(java.util.Date, double)
	 */
	@Override
	public List<StockDailyKLine> findStockLineByOverRatio(Date refDate,
			double ratio) throws DataAccessException {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see org.vsg.stock.core.persistence.StockDailyKLineDao#getDailyLineFromDate(java.lang.String, java.util.Date)
	 */
	@Override
	public StockDailyKLine getDailyLineFromDate(String stockCode, Date date)
			throws DataAccessException {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see org.vsg.stock.core.persistence.StockDailyKLineDao#getStkDailyLineByMinVolInCycle(java.lang.String, long, java.util.Date, int)
	 */
	@Override
	public StockDailyKLine getStkDailyLineByMinVolInCycle(String stockCode,
			long vol, Date fromDate, int cycle) throws DataAccessException {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see org.vsg.stock.core.persistence.StockDailyKLineDao#getStkDailyLineByMinVolInCycle(java.lang.String, java.util.Date, int)
	 */
	@Override
	public StockDailyKLine getStkDailyLineByMinVolInCycle(String stockCode,
			Date fromDate, int cycle) throws DataAccessException {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see org.vsg.stock.core.persistence.StockDailyKLineDao#saveAll(java.util.Collection)
	 */
	@Override
	public void saveAll(Collection<StockDailyKLine> entities)
			throws DataAccessException {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see org.vsg.stock.core.persistence.StockDailyKLineDao#updateStockDateExRights(java.lang.String, java.util.Date)
	 */
	@Override
	public void updateStockDateExRights(String stkCode, Date refDate)
			throws DataAccessException {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see org.vsg.stock.core.persistence.StockDailyKLineDao#updateStockExRights(java.lang.String)
	 */
	@Override
	public void updateStockExRights(String stkCode) throws DataAccessException {
		// TODO Auto-generated method stub

	}

}
